package com.iflytek.aisol.audit.iflytek.strategy.manage.mapper.fr;

import cn.hutool.core.bean.BeanUtil;
import com.iflytek.aisol.audit.iflytek.strategy.manage.entity.FrGrayConfigChannel;
import com.iflytek.aisol.audit.iflytek.strategy.manage.entity.FrGrayConfigServerInstance;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface FrGrayConfigChannelMapper extends JpaRepository<FrGrayConfigChannel, Long> {
    @Modifying
    @Query("DELETE FROM FrGrayConfigChannel g WHERE g.grayConfigId = :grayConfigId")
    void deleteByGrayId(Long grayConfigId);

    @Query("SELECT g FROM FrGrayConfigChannel g WHERE g.channelConfigId = :id")
    List<FrGrayConfigChannel> findByChannelConfigId(@Param("id") Long id);
}
